/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bookshop.facade;

import com.bookshop.entity.CustomerorderBook;
import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

/**
 *
 * @author Thibault
 */
@Stateless
public class CustomerorderBookFacade extends AbstractFacade<CustomerorderBook> {
    @PersistenceContext(unitName = "BookShop-ejbPU")
    private EntityManager em;

    @Override
    protected EntityManager getEntityManager() {
        return em;
    }

    public CustomerorderBookFacade() {
        super(CustomerorderBook.class);
    }
    
    public List<CustomerorderBook> getCartIems(){
        Query query = em.createNamedQuery("CustomerorderBook.findAll");
        List<CustomerorderBook> cartItems = query.getResultList();
        return cartItems;
    }
}
